<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function add_drawing_collaborators($user_id, $object_id, $role) {
    if(!$user_id || !$object_id)
        return FALSE;
    $timestamp = time();
    $query = "INSERT INTO drawing_collaborators(object_id, user_id, role, timestamp)
                    VALUES('$object_id', '$user_id', '$role', '$timestamp')";

    return safe_insert_query($query);
}

function get_drawing_collaborators($object_id) {
    $query = "SELECT id, object_id, user_id, role, timestamp FROM drawing_collaborators WHERE object_id = '$object_id'";
    return safe_select_query($query);
}

?>
